<?php

namespace App\Listeners;

use App\Events\SendBaobeiEvent;
use App\Repository\WechatRepository;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendBaobeiListener implements ShouldQueue
{
    protected $wechatRepository;
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(WechatRepository $wechatRepository)
    {
        $this->wechatRepository=$wechatRepository;
    }

    /**
     * Handle the event.
     *
     * @param  SendBaobeiEvent  $event
     * @return void
     */
    public function handle(SendBaobeiEvent $event)
    {
        $this->wechatRepository->wechatSendBaobeiMessage($event->user,$event->project,$event->time);
    }
}
